{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a= 10\n",
      "a=10\n",
      "a=10\n",
      "a=10\n",
      "a=10\n"
     ]
    }
   ],
   "source": [
    "# 1. 注释\n",
    "# # pyhthon\n",
    "# // /* */  c语言 c++ java\n",
    "# -- sql\n",
    "\n",
    "# 2.\n",
    "# 编译型(c c++) 编译成二进制机器码\n",
    "# 解释型 边解释 边执行 (效率低)\n",
    "# pyhthon 解释型\n",
    "\n",
    "# 3. \n",
    "# input() 输入\n",
    "# print() 打印\n",
    "# len()   长度\n",
    "# type()  得到类型\n",
    "# a = 3.5\n",
    "# print(type(a))\n",
    "\n",
    "# 4. 数据类型\n",
    "# string \n",
    "# float\n",
    "# int\n",
    "# boolean\n",
    "\n",
    "# 5. 字符串\n",
    "# a = \"123\"\n",
    "# a = a + \"abc\"\n",
    "# print(a)\n",
    "\n",
    "a  = 10 \n",
    "# print(\"a=\"+a) 报错\n",
    "print(\"a=\",a)\n",
    "print(\"a=\"+str(a))\n",
    "print(\"a=%d\"%(a))\n",
    "print(f\"a={a}\")\n",
    "print(\"a={}\".format(a))\n",
    "\n",
    "# 7. \n",
    "student_name = \"张三\"\n",
    "\n",
    "# 13\n",
    "[1,2,3,1] 列表:  有序、可重复\n",
    "(1,2,3,1) 元组： 有序、可重复 不能修改\n",
    "{1,2,3}   集合:  无序、不可重复\n",
    "{\n",
    "    \"zhangsan\":100,\n",
    "    \"lisi\":100\n",
    "}         字典:  键值对存储 键不能重复 \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2000.0\n"
     ]
    }
   ],
   "source": [
    "print(2e3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "slice('abc123', 1, 2)\n"
     ]
    }
   ],
   "source": [
    "# 26题?\n",
    "print(slice(\"abc123\",1,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['a', 'b', 'd']\n"
     ]
    }
   ],
   "source": [
    "l = ['a','b','c','d']\n",
    "# 按照内容删除\n",
    "#l.remove('c')\n",
    "# 按照位置删除\n",
    "l.pop(2)\n",
    "print(l)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "张三\n",
      "['李四', '王五']\n",
      "李四\n",
      "['王五']\n",
      "王五\n",
      "[]\n"
     ]
    }
   ],
   "source": [
    "l = []\n",
    "l.append(\"张三\")\n",
    "l.append(\"李四\")\n",
    "l.append(\"王五\")\n",
    "print(l.pop(0))\n",
    "print(l)\n",
    "print(l.pop(0))\n",
    "print(l)\n",
    "print(l.pop(0))\n",
    "print(l)\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "l.append(\"张三\")\n",
    "l.append(\"李四\")\n",
    "l.append(\"王五\")\n",
    "print(l.pop())\n",
    "print(l)\n",
    "print(l.pop())\n",
    "print(l)\n",
    "print(l.pop())\n",
    "print(l)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
